package org.datascooter.bundle.attribute;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * Class purposed for defining an data base indexes
 * 
 * @author nemo
 * 
 */
public class DBIndex {

	public final String name;
	public final String type;
	private List<PersistAttribute> attributeList = new ArrayList<PersistAttribute>();

	public DBIndex(String name, String type) {
		this.name = name;
		this.type = type;
	}

	public DBIndex(String name, String type, PersistAttribute... attributes) {
		this(name, type);
		attributeList = Arrays.asList(attributes);
	}

	public DBIndex addAttribute(PersistAttribute attribute) {
		attributeList.add(attribute);
		return this;
	}

	public List<PersistAttribute> getAttributeList() {
		return attributeList;
	}

	public String getName() {
		return name;
	}
}
